import './css/style.scss';
if(process.env.NODE_ENV=="development"){
    require('./utils/source.tool.js');
}

window.$=require('jquery');
window.zLoad=require('./utils/z.js');
let config=require('../au.config.js');
window.host=config.serviceHost;
//加载
(function load(list) {
    let href = location.href;
    function load(it) {
        zLoad.asyncLoadJs(host+'/modules/'+it.module+'.js');
    }
    for (let it of list) {
        if (it.match instanceof RegExp) {
            if (it.match.test(href)) {
                load(it);
            }
        }else if(typeof it.match ==="string"){
            if (new RegExp(it.match,"ig").test(href)) {
                load(it);
            }
        } else if (it.match.length > 0) {
            for (let match of it.match) {
                if (new RegExp(match,"ig").test(href)) {
                    load(it);
                }
            }
        }
    }
})(config.modules);
